import java.util.Arrays;
import java.util.Scanner;

public class Main8 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        String s = scanner.nextLine();
        String[] s1 = s.split(" ");
        long[] team = new long[3*n];
        for (int i = 0; i < 3 * n; i++) {
            team[i] = Long.parseLong(s1[i]);
        }
        Arrays.sort(team);
        long teamMax = 0;
        int i = 0;
        for (int right = team.length - 2; i < n; right -= 2, i++) {
            teamMax += team[right];
        }
        System.out.print(teamMax);
    }
}
